<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-orderCj-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">上传文件(合伙人订单)：</label>
            <div class="col-sm-8">
                <input id="file" type="file" name="file" class="file-box" accept="application/vnd.ms-excel">
            </div>
        </div>


    </form>
</div>
<div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/select/select2.js}"></script>
<script type="text/javascript">

    var prefix = ctx + "system/paymentOrder"
    $("#form-orderCj-add").validate({
        rules: {
            file: {
                required: true,
            },
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            var formdata = new FormData();
            formdata.append('file', $('#file').get(0).files[0]);
            $.modal.loading("正在处理中，请稍后...");
            $.ajax({
                url: prefix + "/uploadPartnerOrder",
                data: formdata,
                type: "post",
                processData: false,
                contentType: false,
                async : false,
                error : function(request) {
                    $.modal.alertError(request);
                },
                success : function(data) {
                    $.operate.successCallback(data);
                }
            })
        }
    }
</script>
</body>
</html>
